package top.moxingwang.javawork.concurrent;

import java.util.concurrent.TimeUnit;

public class SynchronizedTest {
    public static void main(String[] args) {
        SynchronizedTest synchronizedTest = new SynchronizedTest();
        synchronizedTest.test1();
    }

    public synchronized void test1() {
        try {
            TimeUnit.SECONDS.sleep(100);
            System.out.println(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
